const mongoose = require('mongoose')
const mongoosePaginate = require('mongoose-paginate-v2')
const Schema = mongoose.Schema

let ProductSchema = new Schema({
  sku: String,
  title: String,
  brand: String,
  season: String,
  category: String,
  price: Number,
  status: String,
  sizes: [String],
  colors: [String],
  description: {
    text: String,
    url: [String]
  },
  thumbnail: String,
  media:[{
    _type: String,
    url: String
  }],
  generateTime: { type: Date, default: Date.now }
})

ProductSchema.plugin(mongoosePaginate)

module.exports = mongoose.model('Product', ProductSchema)